package com.zx.练习题.demo;

public class Demo6 {

    //3.(java8)定义一个FunctionalInterface，使得可以将System.out::println赋值给该FunctionInterface类型的变量
    public static void main(String[] args) {
        Demo6.handel(System.out::println, "张三");
    }

    public static <T> void handel(MyHandle<T> handle, T t) {
        System.out.println("before");
        handle.handle(t);
        System.out.println("end");
    }

    @FunctionalInterface
    public static interface MyHandle<T> {

        void handle(T t);
    }
}
